package cn.iocoder.yudao.module.tms.dal.mysql.order;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tms.dal.dataobject.order.OrderDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.tms.controller.admin.order.vo.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;

/**
 * 公司产品信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderMapper extends BaseMapperX<OrderDO> {

    default PageResult<OrderDO> selectPage(OrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderDO>()
                .eqIfPresent(OrderDO::getCompanyId, reqVO.getCompanyId())
                .eqIfPresent(OrderDO::getClientNumber, reqVO.getClientNumber())
                .likeIfPresent(OrderDO::getEnglishName, reqVO.getEnglishName())
                .likeIfPresent(OrderDO::getChineseName, reqVO.getChineseName())
                .eqIfPresent(OrderDO::getHsCode, reqVO.getHsCode())
                .eqIfPresent(OrderDO::getQuantity, reqVO.getQuantity())
                .eqIfPresent(OrderDO::getPackageCount, reqVO.getPackageCount())
                .eqIfPresent(OrderDO::getGrossWeight, reqVO.getGrossWeight())
                .eqIfPresent(OrderDO::getVolume, reqVO.getVolume())
                .eqIfPresent(OrderDO::getMaterial, reqVO.getMaterial())
                .eqIfPresent(OrderDO::getPurpose, reqVO.getPurpose())
                .eqIfPresent(OrderDO::getOrderPhoto, reqVO.getOrderPhoto())
                .eqIfPresent(OrderDO::getUnitPrice, reqVO.getUnitPrice())
                .eqIfPresent(OrderDO::getTotalPrice, reqVO.getTotalPrice())
                .eqIfPresent(OrderDO::getModelNumber, reqVO.getModelNumber())
                .eqIfPresent(OrderDO::getBrand, reqVO.getBrand())
                .eqIfPresent(OrderDO::getSystemNumber, reqVO.getSystemNumber())
                .eqIfPresent(OrderDO::getClearanceMethod, reqVO.getClearanceMethod())
                .eqIfPresent(OrderDO::getCertificateType, reqVO.getCertificateType())
                .eqIfPresent(OrderDO::getChannelType, reqVO.getChannelType())
                .eqIfPresent(OrderDO::getOrderProperty, reqVO.getOrderProperty())
                .eqIfPresent(OrderDO::getProcessStatus, reqVO.getProcessStatus())
                .betweenIfPresent(OrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderDO::getId));
    }
    
    default PageResult<OrderDO> selectPage(PageParam pageParam, LambdaQueryWrapperX<OrderDO> queryWrapper) {
        return BaseMapperX.super.selectPage(pageParam, queryWrapper);
    }

}